import React, { Fragment } from 'react';
import { Route } from 'react-router-dom'
import App from './containers/app.js';
import Count from './containers/Count';
import Home from './containers/Home';
import Login from './containers/Login';
import Logout from './containers/Logout';
import Profile from './containers/Profile';

export default [
    {
        path: '/',
        component: App,
        components: [
            {
                path: '/',
                component: Home,
                exact: true,
                key: '/home',
                loadData: Home.loadData  // 需要加载 异步数据。
            },
            {
                path: '/count',
                component: Count,
                key: '/count'
            },
            {
                path: '/login',
                component: Login,
                key: '/login'
            },
            {
                path: '/logout',
                component: Logout,
                key: '/logout'
            },
            {
                path: '/profile',
                component: Profile,
                key: '/profile'
                // loadData: Home.loadData  // 需要加载 异步数据。 
            }
        ]
    }
]

// export default [
//     {
//       path: '/',
//       component: Home,
//       exact: true,
//       key: '/',
//       loadData: Home.loadData // 需要加载 异步数据。
//     },
//     {
//         path: '/count',
//         component: Count,
//         key: '/count'
//     },
// ]

// export default (
//     <Fragment>
//         <Route path="/" exact component={Home}/>
//         <Route path="/count" component={Count}/>
//     </Fragment>
// )
